/* 重置和基础样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 会议室容器 */
.meeting-room {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  background-color: #f0f2f5;
  overflow: hidden;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 错误消息 */
.error-message {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background-color: rgba(255, 77, 79, 0.9);
  color: white;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.error-message button {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

/* 视频容器 */
.video-container {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 8px;
  overflow-y: auto;
}

/* 多人视频网格布局 */
.video-container:has(.peer-video) {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* 视频样式 */
.user-video,
.peer-video {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background-color: #ffffff; /* 改为白色背景 */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  aspect-ratio: 16/9;
}

.user-video video,
.peer-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 视频禁用时的样式 */
.video-disabled {
  background-color: #f5f5f5; /* 禁用时使用浅灰色背景 */
  filter: none; /* 移除灰度滤镜 */
}

.video-disabled::after {
  content: '摄像头已关闭';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #666; /* 文字颜色改为深灰色 */
  font-size: 14px;
}

/* 说话状态指示器 */
.speaking {
  border: 3px solid #4caf50;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
}

.speaking-indicator {
  color: #4caf50;
  margin-left: 4px;
  font-size: 16px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}

/* 用户名称 */
.user-name {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

/* 鲜花显示 */
.flower-display {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
}

.send-flower-btn {
  background: transparent;
  border: none;
  color: #ff6b6b;
  margin-left: 4px;
  padding: 2px;
  cursor: pointer;
  font-size: 14px;
}

/* 鲜花动画 */
.flower-animation {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 50px;
  animation: flower-float 2s ease-in-out;
  opacity: 0;
}

@keyframes flower-float {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -30%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -100%) scale(0.8);
  }
}

/* 控制栏容器样式 */
.controls {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background-color: #fff;
  border-top: 1px solid #e8e8e8;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
  gap: 20px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
}

.controls-group {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
}

/* 统一按钮样式 */
.controls button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f5f5f5;
  color: #333;
  font-size: 20px;
  transition: all 0.2s ease;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

.controls button:hover {
  background-color: #e6f7ff;
  transform: scale(1.05);
}

.controls button:active {
  transform: scale(0.95);
}

.controls button.active {
  background-color: #1890ff;
  color: white;
}

/* 会议纪要按钮特殊样式 */
.controls button[title='会议纪要'] {
  font-size: 18px;
  background-color: #f0f0f0;
  transition: all 0.3s ease;
}

.controls button[title='会议纪要']:hover {
  background-color: #e6f7ff;
  transform: scale(1.05);
}

.controls button[title='会议纪要'].active {
  background-color: #52c41a;
  color: white;
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(82, 196, 26, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(82, 196, 26, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(82, 196, 26, 0);
  }
}

/* 录音指示器 */
.recording-indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  color: #ff4d4f;
  font-size: 12px;
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.controls button.disabled {
  background-color: #ff4d4f;
  color: white;
}

/* 离开按钮特殊样式 */
.leave-btn {
  background-color: #ff4d4f !important;
  color: white !important;
}

/* 未读消息徽章 */
.unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #ff4d4f;
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 复制成功提示 */
.copied-text {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* 美颜控制滑块 */
.beauty-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.beauty-slider {
  margin: 5px 0;
  width: 45%;
}

.beauty-slider label {
  color: white;
  font-size: 12px;
  display: flex;
  flex-direction: column;
}

.beauty-slider input[type='range'] {
  width: 100%;
  margin-top: 5px;
  height: 18px;
}

/* 参会人员面板 */
.participants {
  position: fixed;
  top: 0;
  right: 0;
  width: 80%;
  max-width: 280px;
  height: 100%;
  background-color: white;
  z-index: 900;
  display: flex;
  flex-direction: column;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  animation: slide-in-right 0.3s ease-out;
}

@keyframes slide-in-right {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.participants h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 12px;
  margin: 0;
  font-size: 16px;
  border-bottom: 1px solid #e8e8e8;
  background-color: #f9f9f9;
}

.participants h3 button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
}

.participants ul {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0;
}

.participant-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.participant-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
}

.participant-flowers {
  display: flex;
  align-items: center;
  margin-left: 8px;
}

.participant-send-flower {
  background: none;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  padding: 4px;
}

/* 聊天容器 */
.chat-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 80%;
  max-width: 280px;
  height: 100%;
  background-color: white;
  z-index: 900;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  animation: slide-in-left 0.3s ease-out;
}

@keyframes slide-in-left {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 12px;
  border-bottom: 1px solid #e8e8e8;
  background-color: #f9f9f9;
}

.chat-header h3 {
  margin: 0;
  font-size: 16px;
}

.chat-header .close-button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.chat-message {
  margin-bottom: 10px;
  max-width: 85%;
}

.own-message {
  margin-left: auto;
  text-align: right;
}

.message-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #888;
  margin-bottom: 2px;
}

.own-message .message-header {
  flex-direction: row-reverse;
}

.message-content {
  background-color: #e6f7ff;
  border-radius: 12px;
  padding: 8px 12px;
  display: inline-block;
  word-break: break-word;
}

.own-message .message-content {
  background-color: #d9f7be;
}

.system-message {
  text-align: center;
  margin: 10px 0;
  color: #999;
  font-size: 12px;
}

/* 聊天输入表单 */
.chat-input-form {
  display: flex;
  padding: 10px;
  border-top: 1px solid #e8e8e8;
  position: relative;
}

.chat-input {
  flex: 1;
  border: 1px solid #d9d9d9;
  border-radius: 20px;
  padding: 8px 12px;
  outline: none;
}

.chat-input:focus {
  border-color: #1890ff;
}

.send-button {
  margin-left: 8px;
  border: none;
  background-color: #1890ff;
  color: white;
  border-radius: 20px;
  padding: 0 12px;
  cursor: pointer;
}

/* 表情按钮样式 */
.emoji-button {
  background: none;
  border: none;
  color: #1890ff;
  font-size: 18px;
  cursor: pointer;
  margin: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.emoji-button:hover {
  color: #40a9ff;
  background-color: #f0f2f5;
  border-radius: 50%;
}

/* 表情选择器容器 */
.emoji-picker-container {
  position: absolute;
  bottom: 60px;
  left: 10px;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  overflow: hidden;
  max-height: 350px;
  max-width: 280px;
}

/* 自定义表情选择器样式 */
.emoji-picker-container .EmojiPickerReact {
  --epr-hover-bg-color: #f0f2f5;
  --epr-focus-bg-color: #e6f7ff;
  --epr-category-label-bg-color: #ffffff;
  border: 1px solid #e8e8e8;
}

/* 响应式调整 */
@media (max-width: 400px) {
  .emoji-picker-container {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    bottom: 50px;
    max-height: 300px;
  }

  .emoji-picker-container .EmojiPickerReact {
    width: 100% !important;
  }
}

/* 白板样式 */
.whiteboard-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 900;
  background-color: rgba(255, 255, 255, 0.98);
  display: flex;
  flex-direction: column;
  animation: fade-in 0.3s ease-in-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.whiteboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background-color: #f0f0f0;
  border-bottom: 1px solid #ddd;
}

.whiteboard-header h3 {
  margin: 0;
  font-size: 16px;
  color: #333;
}

.whiteboard-header .close-button {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 0 5px;
}

.whiteboard-header .close-button:hover {
  color: #ff4d4f;
}

.whiteboard-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background-color: #f9f9f9;
  border-bottom: 1px solid #eee;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-label {
  font-size: 14px;
  color: #666;
  white-space: nowrap;
}

.color-picker {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
}

.line-width-slider {
  width: 100px;
  height: 6px;
}

.line-width-value {
  font-size: 12px;
  color: #666;
  min-width: 30px;
  text-align: center;
}

.tool-button {
  display: flex;
  align-items: center;
  gap: 5px;
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-button:hover {
  background-color: #e6f7ff;
  border-color: #1890ff;
  color: #1890ff;
}

.whiteboard-canvas {
  flex: 1;
  background-color: white;
  touch-action: none; /* 防止触摸事件导致页面滚动 */
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
  -webkit-user-select: none; /* 防止选择文本 */
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.whiteboard-status {
  padding: 8px;
  background-color: #f9f9f9;
  border-top: 1px solid #eee;
  text-align: center;
}

.whiteboard-status p {
  margin: 0;
  font-size: 12px;
  color: #888;
}

/* 移动设备适配 */
@media (max-width: 768px) {
  .whiteboard-tools {
    gap: 10px;
    padding: 8px;
  }

  .tool-group {
    gap: 5px;
  }

  .tool-label {
    font-size: 12px;
  }

  .line-width-slider {
    width: 80px;
  }

  .tool-button {
    padding: 5px 10px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .whiteboard-tools {
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 12px;
  }

  .tool-group {
    width: 100%;
    justify-content: space-between;
  }

  .line-width-slider {
    flex: 1;
    max-width: 150px;
  }
}

/* 送花确认面板 */
.flower-confirm-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.flower-confirm-content {
  background-color: white;
  width: 85%;
  max-width: 280px;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-align: center;
}

.flower-confirm-content h3 {
  margin: 0 0 15px;
  color: #333;
}

.flower-confirm-buttons {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  gap: 10px;
}

.confirm-btn,
.cancel-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.confirm-btn {
  background-color: #ff6b6b;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.cancel-btn {
  background-color: #f0f0f0;
  color: #333;
}

/* 中等屏幕大小调整 */
@media (max-width: 450px) {
  .controls {
    gap: 12px;
    padding: 8px 6px;
  }

  .controls button {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 15px;
  }
}

/* 小屏幕调整 */
@media (max-width: 400px) {
  .controls {
    gap: 8px;
    padding: 8px 4px;
  }

  .controls button {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 14px;
  }
}

/* 极小屏幕调整 */
@media (max-width: 350px) {
  .controls {
    gap: 4px;
    padding: 6px 4px;
  }

  .controls button {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 12px;
    margin: 0 1px;
  }

  .controls-group {
    gap: 4px;
  }
}

/* 视频回放相关样式 */
.replay-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  height: 80%;
  max-height: 600px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.replay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.replay-header h3 {
  margin: 0;
  color: #333;
  font-size: 18px;
}

.replay-header .close-button {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.replay-header .close-button:hover {
  background-color: #e9ecef;
}

.replay-video-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff; /* 改为白色背景 */
  position: relative;
}

.replay-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #ffffff; /* 视频元素也设置为白色背景 */
}

.replay-controls {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  gap: 12px;
}

.replay-play-btn {
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  transition: background-color 0.2s;
}

.replay-play-btn:hover {
  background: #0056b3;
}

.replay-progress-container {
  flex: 1;
  display: flex;
  align-items: center;
}

.replay-progress {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e9ecef;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.replay-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #007bff;
  cursor: pointer;
}

.replay-progress::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #007bff;
  cursor: pointer;
  border: none;
}

.replay-download-btn {
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  transition: background-color 0.2s;
}

.replay-download-btn:hover {
  background: #1e7e34;
}

.replay-info {
  padding: 12px 20px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  font-size: 14px;
  color: #666;
}

.replay-info p {
  margin: 4px 0;
}

/* 录制状态指示器 */
.recording-indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: #dc3545;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

/* 禁用状态的按钮 */
.control-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.control-button:disabled:hover {
  background-color: #f8f9fa;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .replay-container {
    width: 95%;
    height: 85%;
    max-height: 500px;
  }

  .replay-controls {
    padding: 12px 16px;
    gap: 8px;
  }

  .replay-play-btn,
  .replay-download-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .replay-container {
    width: 98%;
    height: 90%;
  }

  .replay-header {
    padding: 12px 16px;
  }

  .replay-header h3 {
    font-size: 16px;
  }

  .replay-controls {
    padding: 10px 12px;
    gap: 6px;
  }

  .replay-info {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* 爱心图标样式 */
.anticon-heart {
  font-size: 24px;
  transition: all 0.3s ease;
}

.anticon-heart:hover {
  transform: scale(1.2);
}

.liked .anticon-heart {
  color: #ff4d4f !important;
  animation: heartBeat 1s;
}

@keyframes heartBeat {
  0% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.3);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.3);
  }
  70% {
    transform: scale(1);
  }
}

.flower-display .anticon-heart {
  color: #ff4d4f;
  margin-right: 8px;
}

.send-flower-button .anticon-heart {
  color: #ff4d4f;
  font-size: 20px;
}

.send-flower-button:hover .anticon-heart {
  transform: scale(1.2);
  animation: heartFloat 1s infinite;
}

@keyframes heartFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}
